﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ManagerSetPromotionItem.ascx.cs" Inherits="CS424_9pts.Administration.Modules.ManagerSetPromotionItem" %>
<%@ Register Assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI.DataVisualization.Charting" TagPrefix="asp" %>

<div class="section-header">
    <div class="title">
        <img src="../Common/ico-sales.png" alt="Set Promotion Item" />    
    </div>
    <div class="options">
    </div>
</div>

<asp:SqlDataSource ID="SqlDataSourceManagerSetPromotionItem" runat="server" 
    ConnectionString="<%$ ConnectionStrings:CarManagementConnectionString %>" 
    InsertCommand="INSERT INTO PromotionForCarModels(PromotionID, CarModelID, Status) VALUES (,,)" 
    SelectCommand="SELECT PromotionForCarModels.CarModelID, PromotionForCarModels.PromotionID, PromotionDetails.Title, PromotionDetails.GiftInfo, PromotionDetails.Description, PromotionForCarModels.Status FROM PromotionDetails INNER JOIN PromotionForCarModels ON PromotionDetails.PromotionID = PromotionForCarModels.PromotionID INNER JOIN Promotions ON PromotionDetails.PromotionID = Promotions.PromotionID AND PromotionForCarModels.PromotionID = Promotions.PromotionID">
</asp:SqlDataSource>

<asp:FormView ID="FormViewManagerSetPromotionIten" runat="server" AllowPaging="True" 
    DataKeyNames="CarModelID,PromotionID" 
    DataSourceID="SqlDataSourceManagerSetPromotionItem">
    <EditItemTemplate>
        CarModelID:
        <asp:Label ID="CarModelIDLabel1" runat="server" 
            Text='<%# Eval("CarModelID") %>' />
        <br />
        PromotionID:
        <asp:Label ID="PromotionIDLabel1" runat="server" 
            Text='<%# Eval("PromotionID") %>' />
        <br />
        Title:
        <asp:TextBox ID="TitleTextBox" runat="server" Text='<%# Bind("Title") %>' />
        <br />
        GiftInfo:
        <asp:TextBox ID="GiftInfoTextBox" runat="server" 
            Text='<%# Bind("GiftInfo") %>' />
        <br />
        Description:
        <asp:TextBox ID="DescriptionTextBox" runat="server" 
            Text='<%# Bind("Description") %>' />
        <br />
        Status:
        <asp:TextBox ID="StatusTextBox" runat="server" Text='<%# Bind("Status") %>' />
        <br />
        <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" 
            CommandName="Update" Text="Update" />
        &nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server" 
            CausesValidation="False" CommandName="Cancel" Text="Cancel" />
    </EditItemTemplate>
    <InsertItemTemplate>
        CarModelID:
        <asp:TextBox ID="CarModelIDTextBox" runat="server" 
            Text='<%# Bind("CarModelID") %>' />
        <br />
        PromotionID:
        <asp:TextBox ID="PromotionIDTextBox" runat="server" 
            Text='<%# Bind("PromotionID") %>' />
        <br />
        Title:
        <asp:TextBox ID="TitleTextBox" runat="server" Text='<%# Bind("Title") %>' />
        <br />
        GiftInfo:
        <asp:TextBox ID="GiftInfoTextBox" runat="server" 
            Text='<%# Bind("GiftInfo") %>' />
        <br />
        Description:
        <asp:TextBox ID="DescriptionTextBox" runat="server" 
            Text='<%# Bind("Description") %>' />
        <br />
        Status:
        <asp:TextBox ID="StatusTextBox" runat="server" Text='<%# Bind("Status") %>' />
        <br />
        <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" 
            CommandName="Insert" Text="Insert" />
        &nbsp;<asp:LinkButton ID="InsertCancelButton" runat="server" 
            CausesValidation="False" CommandName="Cancel" Text="Cancel" />
    </InsertItemTemplate>
    <ItemTemplate>
        CarModelID:
        <asp:Label ID="CarModelIDLabel" runat="server" 
            Text='<%# Eval("CarModelID") %>' />
        <br />
        PromotionID:
        <asp:Label ID="PromotionIDLabel" runat="server" 
            Text='<%# Eval("PromotionID") %>' />
        <br />
        Title:
        <asp:Label ID="TitleLabel" runat="server" Text='<%# Bind("Title") %>' />
        <br />
        GiftInfo:
        <asp:Label ID="GiftInfoLabel" runat="server" Text='<%# Bind("GiftInfo") %>' />
        <br />
        Description:
        <asp:Label ID="DescriptionLabel" runat="server" 
            Text='<%# Bind("Description") %>' />
        <br />
        Status:
        <asp:Label ID="StatusLabel" runat="server" Text='<%# Bind("Status") %>' />
        <br />
        <asp:LinkButton ID="NewButton" runat="server" CausesValidation="False" 
            CommandName="New" Text="New" />
    </ItemTemplate>
</asp:FormView>
